package com.quarantine.service;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import com.quarantine.dao.*;
import com.quarantine.model.staticmessage;

@Component
@Transactional
public class StaticmessageManager {
	
	private staticmessageDao staticmessageDao;
	
	public staticmessageDao getStaticmessageDao() {
		return staticmessageDao;
	}
@Autowired
	public void setStaticmessageDao(staticmessageDao staticmessageDao) {
		this.staticmessageDao = staticmessageDao;
	}
	@Transactional
	public void save(staticmessage entity) {
		staticmessageDao.save(entity);
		
	}
	    /**
	     * 根据id查找
	     */
	    @Transactional  
		public staticmessage getById(String id) {
			return staticmessageDao.findUniqueBy("id", id);
		}
	    
	    
	    
	    @Transactional     
	    public staticmessage getByCategory(String category){
	    	return staticmessageDao.findUniqueBy("category", category);
	    }
	    @Transactional     
	    /**
	     * 根据id来删除
	     */
	    public void delete(String id){
	    	staticmessageDao.delete(id);
	    }
	
	
}
